package leetcode_1801_1900;

public class LeeCode_1827 {
    public static void main(String[] args) {

    }
    private static int minOperations(int[] nums) {
        int n = nums.length, ans = 0;
        for (int i = 1; i < n; i++) {
            if (nums[i] <= nums[i - 1]){
                int cha = nums[i - 1] - nums[i] + 1;
                nums[i] += cha;
                ans += cha;
            }
        }
        return ans;
    }
}
